package com.learn.callback.level2;

/**
 * <p>项目名称: design-pattern </p>
 *
 * <p>文件名称: Task </p>
 *
 * Template-method class for callback hook execution
 */
public abstract class Task {

    public final void executeWith(Callback callback){
        execute();
        if (callback != null){
            callback.call();
        }

    }

    public abstract void execute();
}
